package com.example.power_test;

import android.app.Activity;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;

public class DIS_light {
	
	public static void setdislight(int light,Activity act){
		Settings.System.putInt(act.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, light);
	}
	
	public static int getdislight(Activity act){
		int light = 0;
		try {
			light = Settings.System.getInt(act.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS);
		} catch (SettingNotFoundException e) {
			e.printStackTrace();
		}
		return light;
	}

}
